﻿<Application 
    x:Class="ThuPhap.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:converter="clr-namespace:ThuPhap.Converter"
    xmlns:c4fToolkit="clr-namespace:Coding4Fun.Phone.Controls;assembly=Coding4Fun.Phone.Controls"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">

    <!--Application Resources-->
    <Application.Resources>
    	<ResourceDictionary>
    		<!--<ResourceDictionary.MergedDictionaries>
    			<ResourceDictionary Source="FontResource.xaml"/>
    		</ResourceDictionary.MergedDictionaries>-->

            <FontFamily x:Key="Font_TMC_Ong_Do">/ThuPhap;component/Resources/Fonts/vniongdo.ttf#.TMC-Ong Do</FontFamily>
            <FontFamily x:Key="Font_VNI_Allegie">/ThuPhap;component/Resources/Fonts/VNI-Allegie.TTF#VNI-Allegie</FontFamily>
            <FontFamily x:Key="Font_VNI_Aptima">/ThuPhap;component/Resources/Fonts/VNI-Aptima-Bold-Italic.TTF#VNI-Aptima</FontFamily>
            <FontFamily x:Key="Font_VNI_Ariston">/ThuPhap;component/Resources/Fonts/VNI-Ariston.TTF#VNI-Ariston</FontFamily>
            <FontFamily x:Key="Font_VNI_Auchon">/ThuPhap;component/Resources/Fonts/VNI-Auchon-Bold.TTF#VNI-Auchon</FontFamily>
            <FontFamily x:Key="Font_VNI_Avo">/ThuPhap;component/Resources/Fonts/VNI-Avo-Bold-Italic.TTF#VNI-Avo</FontFamily>
            <FontFamily x:Key="Font_VNI_Awchon">/ThuPhap;component/Resources/Fonts/VNI-Awchon-Bold.TTF#VNI-Awchon</FontFamily>
            <FontFamily x:Key="Font_VNI_Aztek">/ThuPhap;component/Resources/Fonts/VNI-Aztek.TTF#VNI-Aztek</FontFamily>
            <FontFamily x:Key="Font_VNI_Bandit">/ThuPhap;component/Resources/Fonts/VNI-Bandit.TTF#VNI-Bandit</FontFamily>
            <FontFamily x:Key="Font_VNI_BayBuom">/ThuPhap;component/Resources/Fonts/vnibaybuom.ttf#VNI-Baybuom</FontFamily>
            <FontFamily x:Key="Font_VNI_Bodon">/ThuPhap;component/Resources/Fonts/VNI-Bodon Bold.TTF#VNI-Bodon</FontFamily>
            <FontFamily x:Key="Font_VNI_Bodon_Poster">/ThuPhap;component/Resources/Fonts/VNI-Bodon-Poster.TTF#VNI-Bodon-Poster</FontFamily>
            <FontFamily x:Key="Font_VNI_Book">/ThuPhap;component/Resources/Fonts/VNI-Book-Bold-Italic.TTF#VNI-Book</FontFamily>
            <FontFamily x:Key="Font_VNI_Briquet">/ThuPhap;component/Resources/Fonts/vnibriquet.ttf#VNI-Briquet</FontFamily>
            <FontFamily x:Key="Font_VNI_Broad">/ThuPhap;component/Resources/Fonts/VNI-Broad.TTF#VNI-Broad</FontFamily>
            <FontFamily x:Key="Font_VNI_Brush">/ThuPhap;component/Resources/Fonts/VNI-Brush-Italic.TTF#VNI-Brush</FontFamily>
            <FontFamily x:Key="Font_VNI_Butlong">/ThuPhap;component/Resources/Fonts/VNI-Butlong.ttf#VNI-Butlong</FontFamily>
            <FontFamily x:Key="Font_VNI_Calligraphy">/ThuPhap;component/Resources/Fonts/VNI-Calligraphic.TTF#VNI-Calligraphic</FontFamily>
            <FontFamily x:Key="Font_VNI_Centur">/ThuPhap;component/Resources/Fonts/VNI-Centur-Bold-Italic.TTF#VNI-Centur</FontFamily>
            <FontFamily x:Key="Font_VNI_Commerce">/ThuPhap;component/Resources/Fonts/VNI-Commerce-Bold-Italic.TTF#VNI-Commerce</FontFamily>
            <FontFamily x:Key="Font_VNI_Cooper">/ThuPhap;component/Resources/Fonts/VNI-Cooper-Heavy.TTF#VNI-Cooper</FontFamily>
            <FontFamily x:Key="Font_VNI_Coronet">/ThuPhap;component/Resources/Fonts/VNI-Coronet-Bold-Italic.TTF#VNI-Coronet</FontFamily>
            <FontFamily x:Key="Font_VNI_Couri">/ThuPhap;component/Resources/Fonts/VNI-Couri-Bold-Italic.TTF#VNI-Couri</FontFamily>
            <FontFamily x:Key="Font_VNI_Disney">/ThuPhap;component/Resources/Fonts/VNI-Disney Normal.TTF#VNI-Disney</FontFamily>
            <FontFamily x:Key="Font_VNI_DiuDang">/ThuPhap;component/Resources/Fonts/VNI-Diudang.TTF#VNI-Diudang</FontFamily>
            <FontFamily x:Key="Font_VNI_Dom">/ThuPhap;component/Resources/Fonts/VNI-Dom.TTF#VNI-Dom</FontFamily>
            <FontFamily x:Key="Font_VNI_DOS_Sample" xml:space="preserve">/ThuPhap;component/Resources/Fonts/VNI-DOS Sample Font.TTF#VNI-DOS Sample Font </FontFamily>
            <FontFamily x:Key="Font_VNI_Duff">/ThuPhap;component/Resources/Fonts/VNI-Duff.TTF#VNI-Duff</FontFamily>
            <FontFamily x:Key="Font_VNI_Dur">/ThuPhap;component/Resources/Fonts/VNI-Dur.TTF#VNI-Dur</FontFamily>
            <FontFamily x:Key="Font_VNI_Fato">/ThuPhap;component/Resources/Fonts/VNI-Fato.TTF#VNI-Fato</FontFamily>
            <FontFamily x:Key="Font_VNI_Franko">/ThuPhap;component/Resources/Fonts/VNI-Franko.TTF#VNI-Franko</FontFamily>
            <FontFamily x:Key="Font_VNI_Free">/ThuPhap;component/Resources/Fonts/VNI-Free.TTF#VNI-Free</FontFamily>
            <FontFamily x:Key="Font_VNI_Garam">/ThuPhap;component/Resources/Fonts/VNI-Garam-Bold-Italic.TTF#VNI-Garam</FontFamily>
            <FontFamily x:Key="Font_VNI_Goudy">/ThuPhap;component/Resources/Fonts/VNI-Goudy-Bold.TTF#VNI-Goudy</FontFamily>
            <FontFamily x:Key="Font_VNI_Helve">/ThuPhap;component/Resources/Fonts/VNI-Helve-Bold-Italic.TTF#VNI-Helve</FontFamily>
            <FontFamily x:Key="Font_VNI_Helve_Condense">/ThuPhap;component/Resources/Fonts/VNI-Helve-Condense-Bold-Italic.TTF#VNI-Helve-Condense</FontFamily>
            <FontFamily x:Key="Font_VNI_HLThuPhap">/ThuPhap;component/Resources/Fonts/vnithufap.ttf#VNI-HLThuphap</FontFamily>
            <FontFamily x:Key="Font_VNI_Hobo">/ThuPhap;component/Resources/Fonts/VNI-Hobo.TTF#VNI-Hobo</FontFamily>
            <FontFamily x:Key="Font_VNI_Internet_Email">/ThuPhap;component/Resources/Fonts/VNI-Internet Mail.TTF#VNI-Internet Mail</FontFamily>
            <FontFamily x:Key="Font_VNI_Jamai">/ThuPhap;component/Resources/Fonts/VNI-Jamai.TTF#VNI-Jamai</FontFamily>
            <FontFamily x:Key="Font_VNI_Juni">/ThuPhap;component/Resources/Fonts/VNI-Juni.TTF#VNI-Juni</FontFamily>
            <FontFamily x:Key="Font_VNI_Korin">/ThuPhap;component/Resources/Fonts/VNI-Korin-Bold.TTF#VNI-Korin</FontFamily>
            <FontFamily x:Key="Font_VNI_Kun">/ThuPhap;component/Resources/Fonts/VNI-Kun-Bold-Italic.TTF#VNI-Kun</FontFamily>
            <FontFamily x:Key="Font_VNI_Linus">/ThuPhap;component/Resources/Fonts/VNI-Linus.TTF#VNI-Linus</FontFamily>
            <FontFamily x:Key="Font_VNI_Lithos">/ThuPhap;component/Resources/Fonts/VNI-Lithos.TTF#VNI-Lithos</FontFamily>
            <FontFamily x:Key="Font_VNI_Maria">/ThuPhap;component/Resources/Fonts/VNI-Maria.TTF#VNI-Maria</FontFamily>
            <FontFamily x:Key="Font_VNI_Matisse">/ThuPhap;component/Resources/Fonts/vnimatisse.ttf#VNI-Matisse</FontFamily>
            <FontFamily x:Key="Font_VNI_Meli">/ThuPhap;component/Resources/Fonts/VNI-Meli-Bold-Italic.TTF#VNI-Meli</FontFamily>
            <FontFamily x:Key="Font_VNI_Murray">/ThuPhap;component/Resources/Fonts/VNI-Murray-Bold.TTF#VNI-Murray</FontFamily>
            <FontFamily x:Key="Font_VNI_Netbut">/ThuPhap;component/Resources/Fonts/VNI-Netbut.ttf#VNI-Netbut</FontFamily>
            <FontFamily x:Key="Font_VNI_NhatBan">/ThuPhap;component/Resources/Fonts/VNI-Nhatban.TTF#VNI-Nhatban</FontFamily>
            <FontFamily x:Key="Font_VNI_OngDoHL">/ThuPhap;component/Resources/Fonts/VNI-OngDoHL.ttf#VNI-OngDoHL</FontFamily>
            <FontFamily x:Key="Font_VNI_Palatin">/ThuPhap;component/Resources/Fonts/VNI-Palatin-Bold-Italic.TTF#VNI-Palatin</FontFamily>
            <FontFamily x:Key="Font_VNI_Park">/ThuPhap;component/Resources/Fonts/VNI-Park.TTF#VNI-Park</FontFamily>
            <FontFamily x:Key="Font_VNI_Present">/ThuPhap;component/Resources/Fonts/VNI-Present.TTF#VNI-Present</FontFamily>
            <FontFamily x:Key="Font_VNI_Revue">/ThuPhap;component/Resources/Fonts/VNI-Revue-Bold.TTF#VNI-Revue</FontFamily>
            <FontFamily x:Key="Font_VNI_Script">/ThuPhap;component/Resources/Fonts/VNI-Script-Italic.TTF#VNI-Script</FontFamily>
            <FontFamily x:Key="Font_VNI_Slogan">/ThuPhap;component/Resources/Fonts/VNI-Slogan.ttf#VNI-Slogan</FontFamily>
            <FontFamily x:Key="Font_VNI_Souvir">/ThuPhap;component/Resources/Fonts/VNI-Souvir-Bold-Italic.TTF#VNI-Souvir</FontFamily>
            <FontFamily x:Key="Font_VNI_Swiss_Condense">/ThuPhap;component/Resources/Fonts/VNI-Swiss-Condense-Bold.TTF#VNI-Swiss-Condense</FontFamily>
            <FontFamily x:Key="Font_VNI_Token">/ThuPhap;component/Resources/Fonts/VNI-Tekon-Italic.TTF#VNI-Tekon</FontFamily>
            <FontFamily x:Key="Font_VNI_Thanhcao">/ThuPhap;component/Resources/Fonts/VNI-Thanhcao.TTF#VNI-Thanhcao</FontFamily>
            <FontFamily x:Key="Font_VNI_Thufap1">/ThuPhap;component/Resources/Fonts/vnithufap1.ttf#VNI-Thufap1</FontFamily>
            <FontFamily x:Key="Font_VNI_Thufap2">/ThuPhap;component/Resources/Fonts/vnithufap2.ttf#VNI-Thufap2</FontFamily>
            <FontFamily x:Key="Font_VNI_Thufap3">/ThuPhap;component/Resources/Fonts/vnithufap3.ttf#VNI-Thufap3</FontFamily>
            <FontFamily x:Key="Font_VNI_Thufapfan">/ThuPhap;component/Resources/Fonts/vnithufapfan.ttf#VNI-Thufapfan</FontFamily>
            <FontFamily x:Key="Font_VNI_Times">/ThuPhap;component/Resources/Fonts/VNI-Times-Bold-Italic.TTF#VNI-Times</FontFamily>
            <FontFamily x:Key="Font_VNI_Top">/ThuPhap;component/Resources/Fonts/VNI-Top.TTF#VNI-Top</FontFamily>
            <FontFamily x:Key="Font_VNI_Truck">/ThuPhap;component/Resources/Fonts/VNI-Truck.TTF#VNI-Truck</FontFamily>
            <FontFamily x:Key="Font_VNI_TrungKien">/ThuPhap;component/Resources/Fonts/VNI-Trung Kien.TTF#VNI-Trung Kien</FontFamily>
            <FontFamily x:Key="Font_VNI_Tubes">/ThuPhap;component/Resources/Fonts/VNI-Tubes.TTF#VNI-Tubes</FontFamily>
            <FontFamily x:Key="Font_VNI_Univer">/ThuPhap;component/Resources/Fonts/VNI-Univer.TTF#VNI-Univer</FontFamily>
            <FontFamily x:Key="Font_VNI_Vari">/ThuPhap;component/Resources/Fonts/VNI-Vari.TTF#VNI-Vari</FontFamily>
            <FontFamily x:Key="Font_VNI_Viettay">/ThuPhap;component/Resources/Fonts/vniviettay.ttf#VNI-Viettay</FontFamily>
            <FontFamily x:Key="Font_VNI_Vivi">/ThuPhap;component/Resources/Fonts/VNI-Vivi.TTF#VNI-Vivi</FontFamily>
            <FontFamily x:Key="Font_VNI_Whimsy">/ThuPhap;component/Resources/Fonts/VNI-Whimsy.ttf#VNI-Whimsy</FontFamily>
            <FontFamily x:Key="Font_VNI_Win_Sample">/ThuPhap;component/Resources/Fonts/VNI-WIN Sample Font.TTF#VNI-WIN Sample Font</FontFamily>
            <FontFamily x:Key="Font_VNI_Yahoo">/ThuPhap;component/Resources/Fonts/VNI-Yahoo.TTF#VNI-Yahoo</FontFamily>
            <FontFamily x:Key="Font_VNI_Zap">/ThuPhap;component/Resources/Fonts/VNI-Zap.TTF#VNI-Zap</FontFamily>

            <converter:CodeConverter x:Key="Unicode2VNI"/>
    		<Style x:Key="ControlCell" TargetType="StackPanel">
    			<Setter Property="Height" Value="90"/>
    			<Setter Property="Width" Value="90"/>
    			<Setter Property="Margin" Value="4,2,0,2"/>
    			<!--<Setter Property="Background" Value="{StaticResource PhoneChromeBrush}"/>-->
    			<Setter Property="Background" Value="{StaticResource PhoneAccentBrush}"/>
    		</Style>
    		<Style x:Key="UnSelectedListBox" TargetType="ListBoxItem">
    			<Setter Property="Padding" Value="3"/>
    			<Setter Property="HorizontalContentAlignment" Value="Left"/>
    			<Setter Property="VerticalContentAlignment" Value="Top"/>
    			<Setter Property="Background" Value="Transparent"/>
    			<Setter Property="BorderThickness" Value="1"/>
    			<Setter Property="TabNavigation" Value="Local"/>
    			<Setter Property="Template">
    				<Setter.Value>
    					<ControlTemplate TargetType="ListBoxItem">
    						<Grid Background="{TemplateBinding Background}">
    							<VisualStateManager.VisualStateGroups>
    								<VisualStateGroup x:Name="CommonStates">
    									<VisualState x:Name="Normal"/>
    									<VisualState x:Name="MouseOver"/>
    								</VisualStateGroup>
    								<VisualStateGroup x:Name="SelectionStates">
    									<VisualState x:Name="Unselected"/>
    									<VisualState x:Name="Selected"/>
    								</VisualStateGroup>
    								<VisualStateGroup x:Name="FocusStates">
    									<VisualState x:Name="Focused"/>
    									<VisualState x:Name="Unfocused"/>
    								</VisualStateGroup>
    							</VisualStateManager.VisualStateGroups>
    							<Rectangle x:Name="fillColor" Fill="#FFBADDE9" IsHitTestVisible="False"  
    								Opacity="0" RadiusY="1" RadiusX="1"/>
    							<Rectangle x:Name="fillColor2" Fill="#FFBADDE9" IsHitTestVisible="False"  
    								Opacity="0" RadiusY="1" RadiusX="1"/>
    							<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}"  
    								Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"  
    								Margin="{TemplateBinding Padding}"/>
    							<Rectangle x:Name="FocusVisualElement" RadiusY="1" RadiusX="1" Stroke="#FF6DBDD1"  
    								StrokeThickness="1" Visibility="Collapsed"/>
    						</Grid>
    					</ControlTemplate>
    				</Setter.Value>
    			</Setter>
    		</Style>
    		<!--<FontFamily x:Key="OngDo">/ThuPhap;component/Resources/Fonts/vniongdo.ttf#.TMC-Ong Do</FontFamily>
    		<FontFamily x:Key="BayBuom">/ThuPhap;component/Resources/Fonts/vnibaybuom.ttf#VNI-Baybuom</FontFamily>
    		<FontFamily x:Key="Riquet">/ThuPhap;component/Resources/Fonts/vnibriquet.ttf#VNI-Briquet</FontFamily>
    		<FontFamily x:Key="HLThuPhap">/ThuPhap;component/Resources/Fonts/vnithufap.ttf#VNI-HLThuphap</FontFamily>
    		<FontFamily x:Key="Mastisse">/ThuPhap;component/Resources/Fonts/vnimatisse.ttf#VNI-Matisse</FontFamily>
    		<FontFamily x:Key="Slogan">/ThuPhap;component/Resources/Fonts/vnithuphapslogan.ttf#VNI-Slogan</FontFamily>
    		<FontFamily x:Key="ThuPhap2">/ThuPhap;component/Resources/Fonts/vnithufap2.ttf#VNI-Thufap2</FontFamily>
    		<FontFamily x:Key="ThuPhap3">/ThuPhap;component/Resources/Fonts/vnithufap3.ttf#VNI-Thufap3</FontFamily>
    		<FontFamily x:Key="ThuPhapFan">/ThuPhap;component/Resources/Fonts/vnithufapfan.ttf#VNI-Thufapfan</FontFamily>
    		<FontFamily x:Key="VietTay">/ThuPhap;component/Resources/Fonts/vniviettay.ttf#VNI-Viettay</FontFamily>-->

    		<Style TargetType="c4fToolkit:ColorPicker" x:Key="customStyle">
    			<Setter Property="Template">
    				<Setter.Value>
    					<ControlTemplate TargetType="c4fToolkit:ColorPicker">
    						<Grid>
    							<Grid.ColumnDefinitions>
    								<ColumnDefinition Width="Auto" />
    								<ColumnDefinition Width="*" />
    							</Grid.ColumnDefinitions>
    							<Grid.RowDefinitions>
    								<RowDefinition Height="Auto" />
    								<RowDefinition Height="*" />
    								<RowDefinition Height="Auto" />
    							</Grid.RowDefinitions>
    							<c4fToolkit:ColorSlider
    								Width="28"
    								Margin="0,0,12,0"
    								IsColorVisible="false"
    								x:Name="ColorSlider"
    								Grid.Row="1"/>
    							<Grid
    								x:Name="Body"
    								Grid.Column="1"
    								Grid.Row="1">
    								<Rectangle
    									x:Name="SelectedHueColor"
    									Fill="Red"/>
    								<Rectangle>
    									<Rectangle.Fill>
    										<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
    											<GradientStop Offset="0" Color="White"/>
    											<GradientStop Offset="1" Color="Transparent"/>
    										</LinearGradientBrush>
    									</Rectangle.Fill>
    								</Rectangle>
    								<Rectangle>
    									<Rectangle.Fill>
    										<LinearGradientBrush StartPoint="0,1" EndPoint="0, 0">
    											<GradientStop Offset="0" Color="Black"/>
    											<GradientStop Offset="1" Color="Transparent"/>
    										</LinearGradientBrush>
    									</Rectangle.Fill>
    								</Rectangle>
    								<Grid
    									x:Name="SampleSelector"
    									VerticalAlignment="Top"
    									HorizontalAlignment="Left">
    									<Ellipse Height="22" Stroke="Black" StrokeThickness="5" Width="22"/>
    									<Ellipse Height="24" Stroke="White" StrokeThickness="3" Width="24"/>
    								</Grid>
    							</Grid>
    							<StackPanel Grid.Row="2" Grid.ColumnSpan="2" Orientation="Horizontal">
    								<TextBlock Margin="5,30,0,0" ><Run Text="Color"/></TextBlock>
    								<Rectangle Margin="20,10,0,0" Fill="White" Height="62" Width="62"/>
    								<Rectangle
    									Margin="-63,10,0,0"
    									Width="60"
    									Height="60"
    									Fill="{TemplateBinding SolidColorBrush}" >
    									<Rectangle.Stroke>
    										<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    											<GradientStop Color="Black" Offset="0"/>
    											<GradientStop Color="Black" Offset="1"/>
    										</LinearGradientBrush>
    									</Rectangle.Stroke>
    								</Rectangle>
                                
    							</StackPanel>
    						</Grid>
    					</ControlTemplate>
    				</Setter.Value>
    			</Setter>
    		</Style>
    	</ResourceDictionary>
    </Application.Resources>

    <Application.ApplicationLifetimeObjects>
        <!--Required object that handles lifetime events for the application-->
        <shell:PhoneApplicationService 
            Launching="Application_Launching" Closing="Application_Closing" 
            Activated="Application_Activated" Deactivated="Application_Deactivated"/>
    </Application.ApplicationLifetimeObjects>

</Application>